POV-Ray : Newsgroups : povray.general : #read only supports 3D vectors : Re: #read only supports 3D vectors Server Time
4 Nov 2024 19:23:29 EST (-0500)
  Re: #read only supports 3D vectors  
From: JC (Exether)
Date: 6 Oct 2003 02:42:33
Message: <3f810ed9@news.povray.org>
I never use the #read primitive, it's usually much easier to save in a 
POV-script format (objects declarations, array definitions and 
initialisations, etc.) and to load using the very basic #include 
primitive that has all the parsing functionalities already implemented 
(including 4D and 5D vectors).

JC

None wrote:
> I noticed someone mentionned this in the newsgroups a few years ago, I 
> guess it's still the same?  #read only supports 3D vectors, not 2,4 or 5?  
> Unless I'm doing something wrong?  (Yeah, I know, just use four seperate 
> floats and reassign the 4D vector with them... just not as elegant)
> 
> Example:
> //[...]
> #declare CurColor = <1,1,1,0.8>;
> #if (clock > 0)
>   #fopen ColorFile "curcolor.dat" read
>   #read (ColorFile,CurColor)  // <- Error
>   #fclose ColorFile
> #end
> 
> //[...]
> 
> #macro V4strC(V)
>     concat("<",vstr(4,V,",",10,7),">, ")
> #end
> 
> #fopen ColorFile "curcolor.dat" write
> #write (ColorFile,V4strC(CurColor),"\n")
> #fclose ColorFile


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.